package io.geekidea.boot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;

@Configuration
@EnableAsync
public class AsyncConfig implements AsyncConfigurer {

//  @Bean("asyncTaskExecutor")
//  public ThreadPoolTaskExecutor taskExecutor() {
//    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//    executor.setCorePoolSize(4); // 增加核心线程数
//    executor.setMaxPoolSize(8); // 增加最大线程数
//    executor.setQueueCapacity(100); // 增加队列容量
//    executor.setThreadNamePrefix("scheduled-");
//    executor.initialize();
//    return executor;
//  }

}
